package zjh_20230327;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Arrays;

public class MethodPractise {
    public static void main(String[] args) {
        Class<OldPerson> oldPersonClass = OldPerson.class;
        Method[] methods = oldPersonClass.getMethods();
//        int i = 0;
        for (Method m :
                methods) {
            System.out.println("方法：" + m);
//            i += 1;
        }
//        System.out.println(i);
        System.out.println("========");

        Field[] fields = oldPersonClass.getDeclaredFields();
        for (Field f :
                fields) {
            System.out.println("属性" + f);
        }
    }
}
